﻿using PlainConcepts.Fx.Dnie;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System;
namespace PlainConcepts.Fx.Dnie.Test
{
    
    
    /// <summary>
    ///This is a test class for AssertsTest and is intended
    ///to contain all AssertsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class AssertsTest
    {



        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }


        /// <summary>
        ///A test for IsValidPath
        ///</summary>
        [TestMethod()]
        public void IsValidPathTest()
        {
            string pathFile = Path.Combine(testContextInstance.TestDir, @"Out\PlainConcepts.Fx.Dnie.Test.dll");

            Asserts.IsValidPath(pathFile);
            
        }
        /// <summary>
        ///A test for IsValidPath
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void IsValidPathTest_ThrowArgumentException()
        {
            string pathFile = Path.Combine(testContextInstance.TestDir, Guid.NewGuid().ToString());

            Asserts.IsValidPath(pathFile);

        }

        /// <summary>
        ///A test for IsValidExtension
        ///</summary>
        [TestMethod()]
        public void IsValidExtensionTest()
        {
            string pathFile = Path.Combine(testContextInstance.TestDir, @"Out\PlainConcepts.Fx.Dnie.Test.dll");
            string extension = ".dll";
            Asserts.IsValidExtension(pathFile, extension);
        }
        /// <summary>
        ///A test for IsValidExtension
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void IsValidExtensionTest_ThrowArgumentException()
        {
            string pathFile = Path.Combine(testContextInstance.TestDir, "PlainConcepts.Fx.Dnie.Test.dll");
            string extension = ".test";

            Asserts.IsValidExtension(pathFile, extension);
        }

        /// <summary>
        ///A test for IsNullOrEmpty
        ///</summary>
        [TestMethod()]
        public void IsNullOrEmptyTest()
        {
            string cadena = "notempty";
            string argumentName = "cadena";
            Asserts.IsNullOrEmpty(cadena, argumentName);
        }
        /// <summary>
        ///A test for IsNullOrEmpty
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void IsNullOrEmptyTest_ThrowNewArgumentException()
        {
            string cadena = String.Empty;
            string argumentName = "cadena";
            Asserts.IsNullOrEmpty(cadena, argumentName);
        }
    }
}
